import request from '@/utils/request'
// 接口的封装
export function login(data) {
  return request({
    url: '/admin/auth/login',
    method: 'post',
    data
  })
}

export function getInfo(token) {
  return request({
    url: '/admin/auth/info',
    method: 'get',
    params: { token }
  })
}

export function logout() {
  return request({
    url: '/admin/auth/logout',
    method: 'post'
  })
}

export function getdata(data) {
  return request({
    url: '/admin/user/list',
    method: 'get',
    params: { data }
  })
}

// search
export function search(data) {
  // console.log(data,'data')
  return request({
    url: '/admin/user/detail',
    method: 'get',
    params: { id:data.id }
  })
}
//编辑

export function upEdit(data) {
  // console.log(data,'data')
  return request({
    url: '/admin/user/detail',
    method: 'get',
    params: { ...data }
  })
}
/* 收货地址 */
// 初始化表格
export function homeAddress_getTableData(data) {
  // console.log(data,'data')
  return request({
    url: '/admin/address/list',
    method: 'get',
    params: { ...data }
  })
}
/* 会员收藏 */
// 收藏
export function collect_getTableData(data) {
  // console.log(data,'data')
  return request({
    url: '/admin/collect/list',
    method: 'get',
    params: { ...data }
  })
}
/* 会员足迹 */
// 初始化表格
export function footprint_getTableData(data) {
  // console.log(data,'data')
  return request({
    url: '/admin/footprint/list',
    method: 'get',
    params: { ...data }
  })
}
/* 搜索历史 */
export function search_getTableData(data) {
  // console.log(data,'data')
  return request({
    url: '/admin/history/list',
    method: 'get',
    params: { ...data }
  })
}
/* 意见反馈 */
export function feedback_getTableData(data) {
  // console.log(data,'data')
  return request({
    url: '/admin/feedback/list',
    method: 'get',
    params: { ...data }
  })
}

